% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils_radiobox.R
\name{radiobox}
\alias{radiobox}
\title{DRAFT - addin/ gadget dialog box so RStudio user can pick a radio button
Interactive dialog box of choices (RStudio addin that wraps a Shiny Gadget)}
\usage{
radiobox(
  choiceNames = c("Points", "Shapes", "FIPS"),
  choiceValues = c("latlon", "shp", "fips"),
  label = "Choose one:",
  title = "",
  height = 250,
  width = 100
)
}
\arguments{
\item{choiceNames}{vector of options displayed, e.g., c("Points", "Shapes", "FIPS")}

\item{choiceValues}{vector of corresponding values as returned by the function, e.g., c("latlon", "shp", "fips")}

\item{label}{Appears at top of dialog box and between cancel and done, e.g., "Choose one:"}

\item{title}{Appears just above the list of choices, e.g., "Select One"}

\item{height}{height of box in pixels, e.g., 250}

\item{width}{width of box in pixels, e.g., 100}
}
\value{
one of the choiceValues (if not cancelled/ error), once Done is clicked.
}
\description{
DRAFT - addin/ gadget dialog box so RStudio user can pick a radio button
Interactive dialog box of choices (RStudio addin that wraps a Shiny Gadget)
}
\details{
uses \code{\link[shiny:runGadget]{shiny::runGadget()}}

*** WARNING: AS DRAFTED, CANNOT use within nontrivial scripts or functions
because the \code{\link[=stopApp]{stopApp()}} seems to interrupt other processes and cause problems -
and seems related to a quirk seen if a script or function calls radiobox() twice -
it will work the first time but show a blank popup window the 2d time...
e.g., if you  try to do this:
radius1 <- radiobox()
radius2 <- radiobox()
May all be related to this issue: https://github.com/rstudio/rstudio/issues/13394

Note this function could be defined as an RStudio addin and assigned a keyboard shortcut, if that is useful.
}
\examples{
# chosen <- radiobox()
# cat("you chose", chosen, '\n')
\dontrun{
 junk = function() {
  z =  radiobox()
  # print(z)
  return(z)
 }
 # (note this works after load_all or if it is an exported function)
 radius <- radiobox(
  c("Far (3 miles)", "Medium (2 miles)", "Near (1 mile)"),
  c(3,2,1),
  label = "Radius"
 )
 cat("The radius will be", radius, "miles. \n")

}

}
\keyword{internal}
